#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include <QWidget>
#include <QListWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
#include <QGridLayout>
#include <QHostAddress>
#include <QTcpSocket>

class mainWidget : public QWidget
{
    Q_OBJECT

public:
    mainWidget(QWidget *parent = 0);
    ~mainWidget();

public slots:
    void slotEnter();
    void slotConnected();
    void slotDisconnected();
    void dataReceived();
    void slotSend();

private:
    QListWidget *contentListWidget;
    QLineEdit   *sendLineEdit;
    QPushButton *sendBtn;
    QLabel      *userNameLabel;
    QLineEdit   *userNameLineEdit;
    QLabel      *serverIpLabel;
    QLineEdit   *serverIpLineEdit;
    QLabel      *portLabel;
    QLineEdit   *portLineEdit;
    QPushButton *enterBtn;
    QGridLayout *mainLayout;

    bool        status;
    int         port;
    QHostAddress    *serverIp;
    QString         userName;
    QTcpSocket      *tcpsocket;
};
#endif // MAINWIDGET_H
